package com.ydw.event_;

import org.springframework.beans.factory.annotation.Autowired;
/**
 * 注意,这边注入的是springframework中的context
 */
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * @author HYL
 * @create 2017-07-06 下午4:15
 **/
@Component
public class DemoPublisher {
    @Autowired
    ApplicationContext context;

    public void publish(String msg){
        context.publishEvent(new MyEvent(this,msg));
    }
}
